package com.wangfei.controller;

import com.wangfei.entity.User;
import com.wangfei.service.UserService;
import com.wangfei.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Optional;

@RestController
public class WebController {

    @Autowired
    UserService userService;

    @GetMapping("/")
    public Result index() {
        return Result.success(userService.getUserById(1));
    }
}
